3.14 \(\int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx\)

Optimal. Leaf size=49 \[ -\frac{\sin (c+d x) \cos (c+d x) (a+b \tan (c+d x))}{2 d}+\frac{a x}{2}-\frac{b \log (\cos (c+d x))}{d} \]

[Out]

(a*x)/2 - (b*Log[Cos[c + d*x]])/d - (Cos[c + d*x]*Sin[c + d*x]*(a + b*Tan[c + d*x]))/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0844788, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {819, 635, 203, 260} \[ -\frac{\sin (c+d x) \cos (c+d x) (a+b \tan (c+d x))}{2 d}+\frac{a x}{2}-\frac{b \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]^2*(a + b*Tan[c + d*x]),x]

[Out]

(a*x)/2 - (b*Log[Cos[c + d*x]])/d - (Cos[c + d*x]*Sin[c + d*x]*(a + b*Tan[c + d*x]))/(2*d)

Rule 819

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[((d + e*x)^(
m - 1)*(a + c*x^2)^(p + 1)*(a*(e*f + d*g) - (c*d*f - a*e*g)*x))/(2*a*c*(p + 1)), x] - Dist[1/(2*a*c*(p + 1)),
Int[(d + e*x)^(m - 2)*(a + c*x^2)^(p + 1)*Simp[a*e*(e*f*(m - 1) + d*g*m) - c*d^2*f*(2*p + 3) + e*(a*e*g*m - c*
d*f*(m + 2*p + 2))*x, x], x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && LtQ[p, -1] && GtQ
[m, 1] && (EqQ[d, 0] || (EqQ[m, 2] && EqQ[p, -3] && RationalQ[a, c, d, e, f, g]) ||  !ILtQ[m + 2*p + 3, 0])

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 (a+b x)}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac{\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d}+\frac{\operatorname{Subst}\left (\int \frac{a+2 b x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac{\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d}+\frac{a \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac{b \operatorname{Subst}\left (\int \frac{x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{a x}{2}-\frac{b \log (\cos (c+d x))}{d}-\frac{\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0480753, size = 56, normalized size = 1.14 \[ \frac{a (c+d x)}{2 d}-\frac{a \sin (2 (c+d x))}{4 d}-\frac{b \left (\log (\cos (c+d x))-\frac{1}{2} \cos ^2(c+d x)\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]^2*(a + b*Tan[c + d*x]),x]

[Out]

(a*(c + d*x))/(2*d) - (b*(-Cos[c + d*x]^2/2 + Log[Cos[c + d*x]]))/d - (a*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.035, size = 58, normalized size = 1.2 \begin{align*} -{\frac{b \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{b\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-{\frac{a\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{2\,d}}+{\frac{ax}{2}}+{\frac{ac}{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)^2*(a+b*tan(d*x+c)),x)

[Out]

-1/2/d*b*sin(d*x+c)^2-b*ln(cos(d*x+c))/d-1/2/d*a*sin(d*x+c)*cos(d*x+c)+1/2*a*x+1/2/d*a*c

________________________________________________________________________________________

Maxima [A]  time = 2.51148, size = 70, normalized size = 1.43 \begin{align*} \frac{{\left (d x + c\right )} a + b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac{a \tan \left (d x + c\right ) - b}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*((d*x + c)*a + b*log(tan(d*x + c)^2 + 1) - (a*tan(d*x + c) - b)/(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 2.25526, size = 120, normalized size = 2.45 \begin{align*} \frac{a d x + b \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, b \log \left (-\cos \left (d x + c\right )\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(a*d*x + b*cos(d*x + c)^2 - a*cos(d*x + c)*sin(d*x + c) - 2*b*log(-cos(d*x + c)))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d x \right )}\right ) \sin ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)**2*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*sin(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.43679, size = 558, normalized size = 11.39 \begin{align*} \frac{2 \, a d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, b \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 2 \, a d x \tan \left (d x\right )^{2} + 2 \, a d x \tan \left (c\right )^{2} + b \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, b \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) \tan \left (d x\right )^{2} + 2 \, a \tan \left (d x\right )^{2} \tan \left (c\right ) - 2 \, b \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) \tan \left (c\right )^{2} + 2 \, a \tan \left (d x\right ) \tan \left (c\right )^{2} + 2 \, a d x - b \tan \left (d x\right )^{2} - 4 \, b \tan \left (d x\right ) \tan \left (c\right ) - b \tan \left (c\right )^{2} - 2 \, b \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) - 2 \, a \tan \left (d x\right ) - 2 \, a \tan \left (c\right ) + b}{4 \,{\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right )^{2} + d \tan \left (c\right )^{2} + d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/4*(2*a*d*x*tan(d*x)^2*tan(c)^2 - 2*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d
*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 + 2*a*d*x*tan(d*x)^2 + 2*a*d*x*tan(c
)^2 + b*tan(d*x)^2*tan(c)^2 - 2*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2
*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^2 + 2*a*tan(d*x)^2*tan(c) - 2*b*log(4*(tan(c)^2 + 1)
/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(c
)^2 + 2*a*tan(d*x)*tan(c)^2 + 2*a*d*x - b*tan(d*x)^2 - 4*b*tan(d*x)*tan(c) - b*tan(c)^2 - 2*b*log(4*(tan(c)^2
+ 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)) -
 2*a*tan(d*x) - 2*a*tan(c) + b)/(d*tan(d*x)^2*tan(c)^2 + d*tan(d*x)^2 + d*tan(c)^2 + d)